package com.jwt.demo.sys.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jwt.demo.base.BaseAbstractDao;
import com.jwt.demo.sys.entity.User;
import com.jwt.demo.sys.mapper.UserMapper;
import org.springframework.stereotype.Component;

/**
 * @author 林武杰
 * @date 2021/9/27 17:21
 */
@Component
public class UserDao extends BaseAbstractDao<User, UserMapper> {

    public User getByUsername(String username) {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", username);
        return selectOne(queryWrapper);
    }
}
